library(tidyverse)
Registered S3 methods overwritten by 'dbplyr':
method from
print.tbl_lazy
print.tbl_sql
-- Attaching packages ------------------------------------- tidyverse 1.3.1 --
√ ggplot2 3.3.5 √ purrr 0.3.4
√ tibble 3.1.6 √ dplyr 1.0.8
√ tidyr 1.2.0 √ stringr 1.4.0
√ readr 2.1.2 √ forcats 0.5.1
-- Conflicts ---------------------------------------- tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
library(readxl)
Warning: package ‘readxl’ was built under R version 4.1.3
candy_2015 <- read_excel("../raw_data/boing-boing-candy-2015.xlsx")
candy_2016 <- read_excel("../raw_data/boing-boing-candy-2016.xlsx")
candy_2017 <- read_excel("../raw_data/boing-boing-candy-2017.xlsx")
New names:
* `` -> ...114
here::here()
[1] "C:/Users/mahri/OneDrive/CodeClan/dirty_data_project/dirty_data_codeclan_project_mahri/dirty_data_task_4_mahri"
From glimpse - note that there are a lot of columns that you can’t “view”
glimpse(candy_2015)
Rows: 5,630
Columns: 124
$ Timestamp <dttm> ~
$ `How old are you?` <chr> ~
$ `Are you going actually going trick or treating yourself?` <chr> ~
$ `[Butterfinger]` <chr> ~
$ `[100 Grand Bar]` <chr> ~
$ `[Anonymous brown globs that come in black and orange wrappers]` <chr> ~
$ `[Any full-sized candy bar]` <chr> ~
$ `[Black Jacks]` <chr> ~
$ `[Bonkers]` <chr> ~
$ `[Bottle Caps]` <chr> ~
$ `[Box’o’ Raisins]` <chr> ~
$ `[Brach products (not including candy corn)]` <chr> ~
$ `[Bubble Gum]` <chr> ~
$ `[Cadbury Creme Eggs]` <chr> ~
$ `[Candy Corn]` <chr> ~
$ `[Vials of pure high fructose corn syrup, for main-lining into your vein]` <chr> ~
$ `[Candy that is clearly just the stuff given out for free at restaurants]` <chr> ~
$ `[Cash, or other forms of legal tender]` <chr> ~
$ `[Chiclets]` <chr> ~
$ `[Caramellos]` <chr> ~
$ `[Snickers]` <chr> ~
$ `[Dark Chocolate Hershey]` <chr> ~
$ `[Dental paraphenalia]` <chr> ~
$ `[Dots]` <chr> ~
$ `[Fuzzy Peaches]` <chr> ~
$ `[Generic Brand Acetaminophen]` <chr> ~
$ `[Glow sticks]` <chr> ~
$ `[Broken glow stick]` <chr> ~
$ `[Goo Goo Clusters]` <chr> ~
$ `[Good N' Plenty]` <chr> ~
$ `[Gum from baseball cards]` <chr> ~
$ `[Gummy Bears straight up]` <chr> ~
$ `[Creepy Religious comics/Chick Tracts]` <chr> ~
$ `[Healthy Fruit]` <chr> ~
$ `[Heath Bar]` <chr> ~
$ `[Hershey’s Kissables]` <chr> ~
$ `[Hershey’s Milk Chocolate]` <chr> ~
$ `[Hugs (actual physical hugs)]` <chr> ~
$ `[Jolly Rancher (bad flavor)]` <chr> ~
$ `[Jolly Ranchers (good flavor)]` <chr> ~
$ `[Kale smoothie]` <chr> ~
$ `[Kinder Happy Hippo]` <chr> ~
$ `[Kit Kat]` <chr> ~
$ `[Hard Candy]` <chr> ~
$ `[Lapel Pins]` <chr> ~
$ `[LemonHeads]` <chr> ~
$ `[Licorice]` <chr> ~
$ `[Licorice (not black)]` <chr> ~
$ `[Lindt Truffle]` <chr> ~
$ `[Lollipops]` <chr> ~
$ `[Mars]` <chr> ~
$ `[Mary Janes]` <chr> ~
$ `[Maynards]` <chr> ~
$ `[Milk Duds]` <chr> ~
$ `[LaffyTaffy]` <chr> ~
$ `[Minibags of chips]` <chr> ~
$ `[JoyJoy (Mit Iodine)]` <chr> ~
$ `[Reggie Jackson Bar]` <chr> ~
$ `[Pixy Stix]` <chr> ~
$ `[Nerds]` <chr> ~
$ `[Nestle Crunch]` <chr> ~
$ `[Now'n'Laters]` <chr> ~
$ `[Pencils]` <chr> ~
$ `[Milky Way]` <chr> ~
$ `[Reese’s Peanut Butter Cups]` <chr> ~
$ `[Tolberone something or other]` <chr> ~
$ `[Runts]` <chr> ~
$ `[Junior Mints]` <chr> ~
$ `[Senior Mints]` <chr> ~
$ `[Mint Kisses]` <chr> ~
$ `[Mint Juleps]` <chr> ~
$ `[Mint Leaves]` <chr> ~
$ `[Peanut M&M’s]` <chr> ~
$ `[Regular M&Ms]` <chr> ~
$ `[Mint M&Ms]` <chr> ~
$ `[Ribbon candy]` <chr> ~
$ `[Rolos]` <chr> ~
$ `[Skittles]` <chr> ~
$ `[Smarties (American)]` <chr> ~
$ `[Smarties (Commonwealth)]` <chr> ~
$ `[Chick-o-Sticks (we don’t know what that is)]` <chr> ~
$ `[Spotted Dick]` <chr> ~
$ `[Starburst]` <chr> ~
$ `[Swedish Fish]` <chr> ~
$ `[Sweetums]` <chr> ~
$ `[Those odd marshmallow circus peanut things]` <chr> ~
$ `[Three Musketeers]` <chr> ~
$ `[Peterson Brand Sidewalk Chalk]` <chr> ~
$ `[Peanut Butter Bars]` <chr> ~
$ `[Peanut Butter Jars]` <chr> ~
$ `[Trail Mix]` <chr> ~
$ `[Twix]` <chr> ~
$ `[Vicodin]` <chr> ~
$ `[White Bread]` <chr> ~
$ `[Whole Wheat anything]` <chr> ~
$ `[York Peppermint Patties]` <chr> ~
$ `Please leave any remarks or comments regarding your choices.` <chr> ~
$ `Please list any items not included above that give you JOY.` <chr> ~
$ `Please list any items not included above that give you DESPAIR.` <chr> ~
$ `Guess the number of mints in my hand.` <chr> ~
$ `Betty or Veronica?` <chr> ~
$ `Check all that apply: "I cried tears of sadness at the end of ____________"` <chr> ~
$ `"That dress* that went viral early this year - when I first saw it, it was ________"` <chr> ~
$ `Fill in the blank: "Taylor Swift is a force for ___________"` <lgl> ~
$ `What is your favourite font?` <chr> ~
$ `If you squint really hard, the words "Intelligent Design" would look like.` <chr> ~
$ `Fill in the blank: "Imitation is a form of ____________"` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [JK Rowling]` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [JJ Abrams]` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [Beyoncé]` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [Bieber]` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [Kevin Bacon]` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [Francis Bacon (1561 - 1626)]` <chr> ~
$ `[Sea-salt flavored stuff, probably chocolate, since this is the "it" flavor of the year]` <chr> ~
$ `[Necco Wafers]` <chr> ~
$ `Which day do you prefer, Friday or Sunday?` <chr> ~
$ `Please estimate the degrees of separation you have from the following folks [Bruce Lee]` <lgl> ~
$ `Please estimate the degrees of separation you have from the following folks [JK Rowling]` <lgl> ~
$ `Please estimate the degrees of separation you have from the following folks [Malala Yousafzai]` <lgl> ~
$ `Please estimate the degrees of separation you have from the following folks [Thom Yorke]` <lgl> ~
$ `Please estimate the degrees of separation you have from the following folks [JJ Abrams]` <lgl> ~
$ `Please estimate the degrees of separation you have from the following folks [Hillary Clinton]` <lgl> ~
$ `Please estimate the degrees of separation you have from the following folks [Donald Trump]` <lgl> ~
$ `Please estimate the degrees of separation you have from the following folks [Beyoncé Knowles]` <lgl> ~
glimpse(candy_2016)
Rows: 1,259
Columns: 123
$ Timestamp <dttm> ~
$ `Are you going actually going trick or treating yourself?` <chr> ~
$ `Your gender:` <chr> ~
$ `How old are you?` <chr> ~
$ `Which country do you live in?` <chr> ~
$ `Which state, province, county do you live in?` <chr> ~
$ `[100 Grand Bar]` <chr> ~
$ `[Anonymous brown globs that come in black and orange wrappers]` <chr> ~
$ `[Any full-sized candy bar]` <chr> ~
$ `[Black Jacks]` <chr> ~
$ `[Bonkers (the candy)]` <chr> ~
$ `[Bonkers (the board game)]` <chr> ~
$ `[Bottle Caps]` <chr> ~
$ `[Box'o'Raisins]` <chr> ~
$ `[Broken glow stick]` <chr> ~
$ `[Butterfinger]` <chr> ~
$ `[Cadbury Creme Eggs]` <chr> ~
$ `[Candy Corn]` <chr> ~
$ `[Candy that is clearly just the stuff given out for free at restaurants]` <chr> ~
$ `[Caramellos]` <chr> ~
$ `[Cash, or other forms of legal tender]` <chr> ~
$ `[Chardonnay]` <chr> ~
$ `[Chick-o-Sticks (we don’t know what that is)]` <chr> ~
$ `[Chiclets]` <chr> ~
$ `[Coffee Crisp]` <chr> ~
$ `[Creepy Religious comics/Chick Tracts]` <chr> ~
$ `[Dental paraphenalia]` <chr> ~
$ `[Dots]` <chr> ~
$ `[Dove Bars]` <chr> ~
$ `[Fuzzy Peaches]` <chr> ~
$ `[Generic Brand Acetaminophen]` <chr> ~
$ `[Glow sticks]` <chr> ~
$ `[Goo Goo Clusters]` <chr> ~
$ `[Good N' Plenty]` <chr> ~
$ `[Gum from baseball cards]` <chr> ~
$ `[Gummy Bears straight up]` <chr> ~
$ `[Hard Candy]` <chr> ~
$ `[Healthy Fruit]` <chr> ~
$ `[Heath Bar]` <chr> ~
$ `[Hershey's Dark Chocolate]` <chr> ~
$ `[Hershey’s Milk Chocolate]` <chr> ~
$ `[Hershey's Kisses]` <chr> ~
$ `[Hugs (actual physical hugs)]` <chr> ~
$ `[Jolly Rancher (bad flavor)]` <chr> ~
$ `[Jolly Ranchers (good flavor)]` <chr> ~
$ `[JoyJoy (Mit Iodine!)]` <chr> ~
$ `[Junior Mints]` <chr> ~
$ `[Senior Mints]` <chr> ~
$ `[Kale smoothie]` <chr> ~
$ `[Kinder Happy Hippo]` <chr> ~
$ `[Kit Kat]` <chr> ~
$ `[LaffyTaffy]` <chr> ~
$ `[LemonHeads]` <chr> ~
$ `[Licorice (not black)]` <chr> ~
$ `[Licorice (yes black)]` <chr> ~
$ `[Lindt Truffle]` <chr> ~
$ `[Lollipops]` <chr> ~
$ `[Mars]` <chr> ~
$ `[Mary Janes]` <chr> ~
$ `[Maynards]` <chr> ~
$ `[Mike and Ike]` <chr> ~
$ `[Milk Duds]` <chr> ~
$ `[Milky Way]` <chr> ~
$ `[Regular M&Ms]` <chr> ~
$ `[Peanut M&M’s]` <chr> ~
$ `[Blue M&M's]` <chr> ~
$ `[Red M&M's]` <chr> ~
$ `[Third Party M&M's]` <chr> ~
$ `[Minibags of chips]` <chr> ~
$ `[Mint Kisses]` <chr> ~
$ `[Mint Juleps]` <chr> ~
$ `[Mr. Goodbar]` <chr> ~
$ `[Necco Wafers]` <chr> ~
$ `[Nerds]` <chr> ~
$ `[Nestle Crunch]` <chr> ~
$ `[Now'n'Laters]` <chr> ~
$ `[Peeps]` <chr> ~
$ `[Pencils]` <chr> ~
$ `[Person of Interest Season 3 DVD Box Set (not including Disc 4 with hilarious outtakes)]` <chr> ~
$ `[Pixy Stix]` <chr> ~
$ `[Reese’s Peanut Butter Cups]` <chr> ~
$ `[Reese's Pieces]` <chr> ~
$ `[Reggie Jackson Bar]` <chr> ~
$ `[Rolos]` <chr> ~
$ `[Skittles]` <chr> ~
$ `[Smarties (American)]` <chr> ~
$ `[Smarties (Commonwealth)]` <chr> ~
$ `[Snickers]` <chr> ~
$ `[Sourpatch Kids (i.e. abominations of nature)]` <chr> ~
$ `[Spotted Dick]` <chr> ~
$ `[Starburst]` <chr> ~
$ `[Sweet Tarts]` <chr> ~
$ `[Swedish Fish]` <chr> ~
$ `[Sweetums (a friend to diabetes)]` <chr> ~
$ `[Tic Tacs]` <chr> ~
$ `[Those odd marshmallow circus peanut things]` <chr> ~
$ `[Three Musketeers]` <chr> ~
$ `[Tolberone something or other]` <chr> ~
$ `[Trail Mix]` <chr> ~
$ `[Twix]` <chr> ~
$ `[Vials of pure high fructose corn syrup, for main-lining into your vein]` <chr> ~
$ `[Vicodin]` <chr> ~
$ `[Whatchamacallit Bars]` <chr> ~
$ `[White Bread]` <chr> ~
$ `[Whole Wheat anything]` <chr> ~
$ `[York Peppermint Patties]` <chr> ~
$ `Please list any items not included above that give you JOY.` <chr> ~
$ `Please list any items not included above that give you DESPAIR.` <chr> ~
$ `Please leave any witty, snarky or thoughtful remarks or comments regarding your choices.` <chr> ~
$ `Guess the number of mints in my hand.` <chr> ~
$ `Betty or Veronica?` <chr> ~
$ `"That dress* that went viral a few years back - when I first saw it, it was ________"` <chr> ~
$ `What is your favourite font?` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [JK Rowling]` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [JJ Abrams]` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [Beyoncé]` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [Bieber]` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [Kevin Bacon]` <chr> ~
$ `Please estimate the degree(s) of separation you have from the following celebrities [Francis Bacon (1561 - 1626)]` <chr> ~
$ `Which day do you prefer, Friday or Sunday?` <chr> ~
$ `Do you eat apples the correct way, East to West (side to side) or do you eat them like a freak of nature, South to North (bottom to top)?` <chr> ~
$ `When you see the above image of the 4 different websites, which one would you most likely check out (please be honest).` <chr> ~
$ `[York Peppermint Patties] Ignore` <lgl> ~
glimpse(candy_2017)
Rows: 2,460
Columns: 120
$ `Internal ID` <dbl> 90258773, 9027~
$ `Q1: GOING OUT?` <chr> NA, "No", NA, ~
$ `Q2: GENDER` <chr> NA, "Male", "M~
$ `Q3: AGE` <chr> NA, "44", "49"~
$ `Q4: COUNTRY` <chr> NA, "USA", "US~
$ `Q5: STATE, PROVINCE, COUNTY, ETC` <chr> NA, "NM", "Vir~
$ `Q6 | 100 Grand Bar` <chr> NA, "MEH", NA,~
$ `Q6 | Anonymous brown globs that come in black and orange wrappers\t(a.k.a. Mary Janes)` <chr> NA, "DESPAIR",~
$ `Q6 | Any full-sized candy bar` <chr> NA, "JOY", NA,~
$ `Q6 | Black Jacks` <chr> NA, "MEH", NA,~
$ `Q6 | Bonkers (the candy)` <chr> NA, "DESPAIR",~
$ `Q6 | Bonkers (the board game)` <chr> NA, "DESPAIR",~
$ `Q6 | Bottle Caps` <chr> NA, "DESPAIR",~
$ `Q6 | Box'o'Raisins` <chr> NA, "DESPAIR",~
$ `Q6 | Broken glow stick` <chr> NA, "DESPAIR",~
$ `Q6 | Butterfinger` <chr> NA, "DESPAIR",~
$ `Q6 | Cadbury Creme Eggs` <chr> NA, "MEH", NA,~
$ `Q6 | Candy Corn` <chr> NA, "MEH", NA,~
$ `Q6 | Candy that is clearly just the stuff given out for free at restaurants` <chr> NA, "DESPAIR",~
$ `Q6 | Caramellos` <chr> NA, "MEH", NA,~
$ `Q6 | Cash, or other forms of legal tender` <chr> NA, "JOY", NA,~
$ `Q6 | Chardonnay` <chr> NA, "MEH", NA,~
$ `Q6 | Chick-o-Sticks (we don’t know what that is)` <chr> NA, "DESPAIR",~
$ `Q6 | Chiclets` <chr> NA, "DESPAIR",~
$ `Q6 | Coffee Crisp` <chr> NA, "DESPAIR",~
$ `Q6 | Creepy Religious comics/Chick Tracts` <chr> NA, "DESPAIR",~
$ `Q6 | Dental paraphenalia` <chr> NA, "DESPAIR",~
$ `Q6 | Dots` <chr> NA, "MEH", NA,~
$ `Q6 | Dove Bars` <chr> NA, "JOY", NA,~
$ `Q6 | Fuzzy Peaches` <chr> NA, "DESPAIR",~
$ `Q6 | Generic Brand Acetaminophen` <chr> NA, "DESPAIR",~
$ `Q6 | Glow sticks` <chr> NA, "DESPAIR",~
$ `Q6 | Goo Goo Clusters` <chr> NA, "DESPAIR",~
$ `Q6 | Good N' Plenty` <chr> NA, "MEH", NA,~
$ `Q6 | Gum from baseball cards` <chr> NA, "DESPAIR",~
$ `Q6 | Gummy Bears straight up` <chr> NA, "MEH", NA,~
$ `Q6 | Hard Candy` <chr> NA, "MEH", NA,~
$ `Q6 | Healthy Fruit` <chr> NA, "DESPAIR",~
$ `Q6 | Heath Bar` <chr> NA, "MEH", NA,~
$ `Q6 | Hershey's Dark Chocolate` <chr> NA, "JOY", NA,~
$ `Q6 | Hershey’s Milk Chocolate` <chr> NA, "JOY", NA,~
$ `Q6 | Hershey's Kisses` <chr> NA, "MEH", NA,~
$ `Q6 | Hugs (actual physical hugs)` <chr> NA, "DESPAIR",~
$ `Q6 | Jolly Rancher (bad flavor)` <chr> NA, "DESPAIR",~
$ `Q6 | Jolly Ranchers (good flavor)` <chr> NA, "MEH", NA,~
$ `Q6 | JoyJoy (Mit Iodine!)` <chr> NA, "DESPAIR",~
$ `Q6 | Junior Mints` <chr> NA, "DESPAIR",~
$ `Q6 | Senior Mints` <chr> NA, "DESPAIR",~
$ `Q6 | Kale smoothie` <chr> NA, "DESPAIR",~
$ `Q6 | Kinder Happy Hippo` <chr> NA, "DESPAIR",~
$ `Q6 | Kit Kat` <chr> NA, "JOY", NA,~
$ `Q6 | LaffyTaffy` <chr> NA, "DESPAIR",~
$ `Q6 | LemonHeads` <chr> NA, "MEH", NA,~
$ `Q6 | Licorice (not black)` <chr> NA, "MEH", NA,~
$ `Q6 | Licorice (yes black)` <chr> NA, "JOY", NA,~
$ `Q6 | Lindt Truffle` <chr> NA, "MEH", NA,~
$ `Q6 | Lollipops` <chr> NA, "DESPAIR",~
$ `Q6 | Mars` <chr> NA, "DESPAIR",~
$ `Q6 | Maynards` <chr> NA, "DESPAIR",~
$ `Q6 | Mike and Ike` <chr> NA, "MEH", NA,~
$ `Q6 | Milk Duds` <chr> NA, "MEH", NA,~
$ `Q6 | Milky Way` <chr> NA, "JOY", NA,~
$ `Q6 | Regular M&Ms` <chr> NA, "JOY", NA,~
$ `Q6 | Peanut M&M’s` <chr> NA, "MEH", NA,~
$ `Q6 | Blue M&M's` <chr> NA, "JOY", NA,~
$ `Q6 | Red M&M's` <chr> NA, "JOY", NA,~
$ `Q6 | Green Party M&M's` <chr> NA, "JOY", NA,~
$ `Q6 | Independent M&M's` <chr> NA, "JOY", NA,~
$ `Q6 | Abstained from M&M'ing.` <chr> NA, "DESPAIR",~
$ `Q6 | Minibags of chips` <chr> NA, "DESPAIR",~
$ `Q6 | Mint Kisses` <chr> NA, "MEH", NA,~
$ `Q6 | Mint Juleps` <chr> NA, "DESPAIR",~
$ `Q6 | Mr. Goodbar` <chr> NA, "DESPAIR",~
$ `Q6 | Necco Wafers` <chr> NA, "DESPAIR",~
$ `Q6 | Nerds` <chr> NA, "DESPAIR",~
$ `Q6 | Nestle Crunch` <chr> NA, "JOY", NA,~
$ `Q6 | Now'n'Laters` <chr> NA, "DESPAIR",~
$ `Q6 | Peeps` <chr> NA, "DESPAIR",~
$ `Q6 | Pencils` <chr> NA, "DESPAIR",~
$ `Q6 | Pixy Stix` <chr> NA, "DESPAIR",~
$ `Q6 | Real Housewives of Orange County Season 9 Blue-Ray` <chr> NA, "DESPAIR",~
$ `Q6 | Reese’s Peanut Butter Cups` <chr> NA, "JOY", NA,~
$ `Q6 | Reese's Pieces` <chr> NA, "JOY", NA,~
$ `Q6 | Reggie Jackson Bar` <chr> NA, "DESPAIR",~
$ `Q6 | Rolos` <chr> NA, "JOY", NA,~
$ `Q6 | Sandwich-sized bags filled with BooBerry Crunch` <chr> NA, "DESPAIR",~
$ `Q6 | Skittles` <chr> NA, "DESPAIR",~
$ `Q6 | Smarties (American)` <chr> NA, "DESPAIR",~
$ `Q6 | Smarties (Commonwealth)` <chr> NA, "DESPAIR",~
$ `Q6 | Snickers` <chr> NA, "MEH", NA,~
$ `Q6 | Sourpatch Kids (i.e. abominations of nature)` <chr> NA, "DESPAIR",~
$ `Q6 | Spotted Dick` <chr> NA, "DESPAIR",~
$ `Q6 | Starburst` <chr> NA, "MEH", NA,~
$ `Q6 | Sweet Tarts` <chr> NA, "DESPAIR",~
$ `Q6 | Swedish Fish` <chr> NA, "MEH", NA,~
$ `Q6 | Sweetums (a friend to diabetes)` <chr> NA, "DESPAIR",~
$ `Q6 | Take 5` <chr> NA, "DESPAIR",~
$ `Q6 | Tic Tacs` <chr> NA, "DESPAIR",~
$ `Q6 | Those odd marshmallow circus peanut things` <chr> NA, "DESPAIR",~
$ `Q6 | Three Musketeers` <chr> NA, "JOY", NA,~
$ `Q6 | Tolberone something or other` <chr> NA, "JOY", NA,~
$ `Q6 | Trail Mix` <chr> NA, "DESPAIR",~
$ `Q6 | Twix` <chr> NA, "JOY", NA,~
$ `Q6 | Vials of pure high fructose corn syrup, for main-lining into your vein` <chr> NA, "DESPAIR",~
$ `Q6 | Vicodin` <chr> NA, "DESPAIR",~
$ `Q6 | Whatchamacallit Bars` <chr> NA, "DESPAIR",~
$ `Q6 | White Bread` <chr> NA, "DESPAIR",~
$ `Q6 | Whole Wheat anything` <chr> NA, "DESPAIR",~
$ `Q6 | York Peppermint Patties` <chr> NA, "DESPAIR",~
$ `Q7: JOY OTHER` <chr> NA, "Mounds", ~
$ `Q8: DESPAIR OTHER` <chr> NA, NA, NA, NA~
$ `Q9: OTHER COMMENTS` <chr> NA, "Bottom li~
$ `Q10: DRESS` <chr> NA, "White and~
$ ...114 <chr> NA, NA, NA, NA~
$ `Q11: DAY` <chr> NA, "Sunday", ~
$ `Q12: MEDIA [Daily Dish]` <dbl> NA, NA, NA, NA~
$ `Q12: MEDIA [Science]` <dbl> NA, 1, NA, 1, ~
$ `Q12: MEDIA [ESPN]` <dbl> NA, NA, NA, NA~
$ `Q12: MEDIA [Yahoo]` <dbl> NA, NA, NA, NA~
$ `Click Coordinates (x, y)` <chr> NA, "(84, 25)"~
library(janitor)
Attaching package: ‘janitor’
The following objects are masked from ‘package:stats’:
chisq.test, fisher.test
candy_2015_janitor <- janitor::clean_names(candy_2015)
candy_2015_janitor
candy_2016_janitor <- janitor::clean_names(candy_2016)
candy_2016_janitor
candy_2017_janitor <- janitor::clean_names(candy_2017)
candy_2017_janitor
just looking at who is reporting back about these ones…
candy_2017_janitor %>%
select(q3_age, q2_gender, q6_independent_m_ms, q6_green_party_m_ms)
candy_2016_janitor %>%
select(york_peppermint_patties_ignore)
2015 clean - remove columns that aren’t candy (see readme) I went from bottom to top to check index as i went
2015 clean - renaming columns so they match other years
candy_2015_renamed <- candy_2015_cols_removed %>%
rename(age = how_old_are_you, trick_or_treating = are_you_going_actually_going_trick_or_treating_yourself, mary_janes_1 = anonymous_brown_globs_that_come_in_black_and_orange_wrappers, brach_not_including_candy_corn = brach_products_not_including_candy_corn, restaurant_candy = candy_that_is_clearly_just_the_stuff_given_out_for_free_at_restaurants, hersheys_dark_chocolate = dark_chocolate_hershey, gummy_bears = gummy_bears_straight_up, hersheys_kissables = hershey_s_kissables, hersheys_milk_chocolate = hershey_s_milk_chocolate, licorice_black = licorice, reeses_peanut_butter_cups = reese_s_peanut_butter_cups, toblerone = tolberone_something_or_other, peanut_m_ms = peanut_m_m_s, chick_o_stick = chick_o_sticks_we_don_t_know_what_that_is, circus_peanuts = those_odd_marshmallow_circus_peanut_things, sea_salt_chocolate = sea_salt_flavored_stuff_probably_chocolate_since_this_is_the_it_flavor_of_the_year)
candy_2015_renamed
2016 clean - remove unnecessary columns - bottom to top
candy_2016_removed <- candy_2016_janitor %>%
select(-c(104, 105, 107:123), -c(vicodin, vials_of_pure_high_fructose_corn_syrup_for_main_lining_into_your_vein, trail_mix, spotted_dick, person_of_interest_season_3_dvd_box_set_not_including_disc_4_with_hilarious_outtakes, minibags_of_chips, kale_smoothie, joy_joy_mit_iodine, hugs_actual_physical_hugs, heath_bar, healthy_fruit, glow_sticks, generic_brand_acetaminophen, dental_paraphenalia, creepy_religious_comics_chick_tracts, chardonnay, cash_or_other_forms_of_legal_tender, broken_glow_stick, boxo_raisins, bonkers_the_board_game))
candy_2016_removed
2016 - rename so they match other sheets
candy_2016_renamed <- candy_2016_removed %>%
rename(trick_or_treating = are_you_going_actually_going_trick_or_treating_yourself, gender = your_gender, age = how_old_are_you, country = which_country_do_you_live_in, state_or_prov = which_state_province_county_do_you_live_in, mary_janes_1 = anonymous_brown_globs_that_come_in_black_and_orange_wrappers, bonkers = bonkers_the_candy, restaurant_candy = candy_that_is_clearly_just_the_stuff_given_out_for_free_at_restaurants, chick_o_stick = chick_o_sticks_we_don_t_know_what_that_is, gummy_bears = gummy_bears_straight_up, hersheys_milk_chocolate = hershey_s_milk_chocolate, licorice_black = licorice_yes_black, peanut_m_ms = peanut_m_m_s, party_bag_m_ms = third_party_m_ms, reeses_peanut_butter_cups = reese_s_peanut_butter_cups, sourpatch_kids = sourpatch_kids_i_e_abominations_of_nature, sweetarts = sweet_tarts, sweetums = sweetums_a_friend_to_diabetes, circus_peanuts = those_odd_marshmallow_circus_peanut_things, toblerone = tolberone_something_or_other)
candy_2016_renamed
view(candy_2016_renamed)
2017 clean - remove those not candy
candy_2017_cols_removed <- candy_2017_janitor %>%
select(-c(102, 104, 105, 107, 108, 110:120), -c(q6_spotted_dick, q6_sandwich_sized_bags_filled_with_boo_berry_crunch, q6_real_housewives_of_orange_county_season_9_blue_ray, q6_minibags_of_chips, q6_abstained_from_m_ming, q6_kale_smoothie, q6_joy_joy_mit_iodine, q6_hugs_actual_physical_hugs, q6_heath_bar, q6_healthy_fruit, q6_glow_sticks, q6_generic_brand_acetaminophen, q6_dental_paraphenalia, q6_creepy_religious_comics_chick_tracts, q6_chardonnay, q6_cash_or_other_forms_of_legal_tender, q6_broken_glow_stick, q6_boxo_raisins, q6_bonkers_the_board_game))
candy_2017_cols_removed
2017 - rename - get rid of q1/2/3/4/5/6 at the start of col names and rename to match 2015 and 16
candy_2017_q_removed <- candy_2017_cols_removed %>%
rename_all(~ sub("^[a-z0-9]{2}_", "",
make.names(names(candy_2017_cols_removed))))
candy_2017_renamed <- candy_2017_q_removed %>%
rename(trick_or_treating = going_out, state_or_prov = state_province_county_etc, x100_grand_bar = `100_grand_bar`, mary_janes_1 = anonymous_brown_globs_that_come_in_black_and_orange_wrappers_a_k_a_mary_janes, bonkers = bonkers_the_candy, restaurant_candy = candy_that_is_clearly_just_the_stuff_given_out_for_free_at_restaurants, chick_o_stick = chick_o_sticks_we_don_t_know_what_that_is, gummy_bears = gummy_bears_straight_up, hersheys_milk_chocolate = hershey_s_milk_chocolate, licorice_black = licorice_yes_black, peanut_m_ms = peanut_m_m_s, green_m_ms = green_party_m_ms, lone_m_ms = independent_m_ms, reeses_peanut_butter_cups = reese_s_peanut_butter_cups, sourpatch_kids = sourpatch_kids_i_e_abominations_of_nature, sweetarts = sweet_tarts, sweetums = sweetums_a_friend_to_diabetes, circus_peanuts = those_odd_marshmallow_circus_peanut_things, toblerone = tolberone_something_or_other)
candy_2017_renamed